package org.lex.utils.text;

import java.util.regex.Pattern;

import org.lex.io.IO;


public class Splitter {
	public static final Pattern LineSplitter;
	public static final Pattern BlankSpaceSplitter;
	public static final Pattern DotSplitter;
	public static final Pattern SemicolonSplitter;
	public static final Pattern CommaSplitter;
	public static final Pattern PipeSplitter;
	public static final Pattern BackslashSplitter;

	static {

		BlankSpaceSplitter = get("[ \t\n\f\r]+");
		/*
		 * ������Щ��Ӧ��ʹ��StringTokenizer���棬�Ǹ����
		 * ����ר��дһ��ʹ��char���ָ����Tokenizer
		 */
		// LineSpiltterӦ����ƽ̨��ص�
		LineSplitter = get("[" + IO.newline + "]");
		DotSplitter = get("\\.");// or "[.]"
		SemicolonSplitter = get(";");
		CommaSplitter = get(",");
		PipeSplitter = get("[|]");
		BackslashSplitter = get("/");
	}

	public static Pattern get(String re) {
		return Pattern.compile(re);
	}
}
